// Copyright (c) Microsoft Corporation
// All rights reserved

namespace Microsoft.Windows.Controls.Specialized.TextExtensions
{
    using System;
    using System.Collections.Generic;

    using Microsoft.Windows.Controls.Specialized.TextModel;

    /// <summary>
    /// An object capable of assigning <see cref="IClassificationType"/>s to the text in a <see cref="ITextBuffer"/>.
    /// </summary>
    public interface IClassifier
    {
        /// <summary>
        /// Gets all <see cref="ClassificationSpan"/>s that overlap the given range of text.
        /// </summary>
        /// <param name="textSpan">
        /// The span of interest.
        /// </param>
        /// <returns>
        /// A list of <see cref="ClassificationSpan"/>s that intersect with the given range. 
        /// </returns>
        /// <remarks>
        /// The returned spans must not overlap and must be in ascending sorted order by 
        /// span, but they need not completely cover the requested span.
        /// </remarks>
        IEnumerable<ClassificationSpan> GetClassificationSpans(TextSpan textSpan);

        /// <summary>
        /// Event raised when the classification of a span of text has changed.
        /// </summary>
        event EventHandler<ClassificationChangedEventArgs> ClassificationChanged;
    }
}